<?php namespace app\common\validate;


use think\Validate;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/14
 * Time: 15:13
 */
class LitestoreShop extends Validate {
    protected $rule = [
                    'name'  => 'require',
                    'category_id'  => 'require',
                    'address'  => 'require',
                    'name'  => 'require',
                    'user_card_on'   => 'require',
                    'user_card_back' => 'require',
                    ];
    protected $message = [
                    'name.require' => '商户名称不能为空',
                    'category_id.require' => '所属分类不能为空',
                    'address.require' => '商户地址不能为空',
                    'user_card_on.require' => '商户运营者身份证正面不能为空',
                    'user_card_back.require' => '商户运营者身份证反面不能为空',
                    ];
    // 自定义验证规则
    protected function checkName($value,$rule,$data)
    {
        return $rule == $value ? true : '名称错误';
    }
}